﻿<%@ page contentType="text/html;charset=UTF-8" autoFlush="true"%>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
    <META HTTP-EQUIV="Expires" CONTENT="0">
    <%
        String serverName = request.getServerName();
        int serverPort = request.getServerPort();
        String serverPortStr = (serverPort == 80)?"":(":"+serverPort);
        String protocol = request.getProtocol();
        String protocolStr = "http";
        String contextPath = request.getContextPath();
        String htmlBase = protocolStr+"://"+serverName+serverPortStr+contextPath+"/";
     %>
    <base href="<%=htmlBase%>"/>
    <link rel="stylesheet" rev="stylesheet" href="qa/css/main.css" type="text/css" media="screen" />
    <link rel="stylesheet" rev="stylesheet" href="qa/css/Calendar.css" type="text/css" media="screen" />
    <title>
        <c:if test="${not empty questiono}"><c:out value="${questiono.title}"/> - </c:if>
        <tiles:useAttribute name="psubtitle" id="psubt"/>
        <c:if test="${empty questiono}">
            <c:if test="${not empty questioncategory}"><c:out value="${questioncategory.name}"/> - </c:if>
            <c:if test="${empty questioncategory and not empty questions and empty psubt}">中国大型机行业联盟 - </c:if>
        </c:if>
        <c:if test="${not empty psubt}"><c:out value="${psubt}"/> - </c:if>
        <tiles:getAsString name="ptitle"/>
    </title>
  </head>
  <body>
  <div align="center">
    <!--MR Navigation导航-->
    <table align="center" border="0" cellpadding="0" cellspacing="0" width="900">
        <tr >
            <td>
                   <tiles:insert attribute="mrnavigation"/>
            </td>
       </tr>     
    </table>
    <!--QA Navigation-->
    <table align="center" border="0" cellpadding="0" cellspacing="0" width="900">
        <tr>
            <td>
                    <tiles:insert attribute="qanavigation"/>
            </td>
       </tr>     
    </table>
    <script type="text/javascript">
        var qachannel = "<tiles:getAsString name="qachannel"/>";
        function initQaChannel()
        {
            var qaChannelSpan;
            if("" != qachannel)
            {
                qaChannelSpan = document.getElementById(qachannel);
                if(qaChannelSpan != null)
                {
                    //var no = qaChannelSpan.no;
                    var no = qaChannelSpan.attributes['no'].nodeValue;
                    qaChannelSpan.className = "qachannelselected"+no;              
                    if(no > 1)
                    {
                        var preNo = no-1;
                        //if(no == 4)preNo = 2;
                        var preQaChannelSpan = document.getElementById("qachannel"+preNo);
                        preQaChannelSpan.className = "nobgqachannel"+no;
                    }
                    else
                    {
                    }
                }
            }
        }
        initQaChannel();
    </script>  
   <!--MR content-->
    <table align="center" border="0" cellpadding="0" cellspacing="0" width="900">
        <tr>
            <td width="172" height="100%" valign="top">
                <tiles:insert attribute="login-fragment"/>
                <tiles:insert attribute="left"/>
                <tiles:insert attribute="active-users"/>
                <%-- --google ad(160*600) for view question start --%>
                <c:if test="${param.action == 'view' and param.id != null}">
                    <%
                        request.setAttribute("answersSizePerPage",com.mr.qa.GlobalConfigs.NUMBER_ANSWER_FOR_VIEW_QUESTION);
                        String pageSize = request.getParameter("pageSize");
                        if(pageSize == null)
                        {
                            pageSize = ""+com.mr.qa.GlobalConfigs.NUMBER_ANSWER_FOR_VIEW_QUESTION;
                        }
                        String pageNo = request.getParameter("page");
                        if(pageNo == null)
                        {
                            pageNo = "1";
                        }
                        request.setAttribute("_pageSize",pageSize);
                        request.setAttribute("_pageNo",pageNo);
                    %>
                    <c:set var="_totalAnswersSize" value="${fn:length(questiono.mrIaskAnswers)}"/>
                    <c:set var="_answersSize" value="${_totalAnswersSize-_pageSize*(_pageNo-1)}"/>
                    <c:if test="${questiono.mrIaskCategory.isAds == true or (_totalAnswersSize >= answersSizePerPage and (_answersSize >= answersSizePerPage))}">
                    <br>
                    <div style="border: 1px solid #CCC;padding:8 0 0 5;">
                    <script type="text/javascript"><!--
                    google_ad_client = "pub-3370373040606812";
                    /* MR_Iask_Post 160x600, by William 08-9-14 */
                    google_ad_slot = "3722296763";
                    google_ad_width = 160;
                    google_ad_height = 600;
                    //-->
                    </script>
                    <script type="text/javascript"
                    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
                    </script>
                    </div>
                    </c:if>
                </c:if>
                <%-- --google ad(160*600) for view question end --%>
            </td>
            <td width="8"><td>
            <td valign="top" height="720">
                <!--message-->
                <tiles:insert attribute="message"/>
                <!--body-->
                <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
                            <tr>
                                    <td valign="top"><tiles:insert attribute="center"/></td>    
                            </tr>
                </table>
            </td>
       </tr>     
    </table>
    <%-- --google ad start --%>
    <c:if test="${questionsSize != null and questionsSize >= questionsSizePerPage}">
    <br>
    <div align="center">
        <script type="text/javascript"><!--
        google_ad_client = "pub-3370373040606812";
        /* MR_Iask_List 728x90, by William 08-8-30 */
        google_ad_slot = "7036340927";
        google_ad_width = 728;
        google_ad_height = 90;
        //-->
        </script>
        <script type="text/javascript"
        src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
        </script>
    </div>
    </c:if>
    <%-- --google ad end --%>
    <br>
    <!--QA Footer-->
    <table align="center" border="0" cellpadding="0" cellspacing="0" width="900">
        <tr>
            <td>
                    <!--QA footer-->
                    <tiles:insert attribute="qafooter"/>
            </td>
       </tr>     
    </table>   
    <!--QA Footer-->
    <br>
    <table align="center" border="0" cellpadding="0" cellspacing="0" width="900">
        <tr>
            <td>
                <!--MR footer-->            
                <tiles:insert attribute="mrfooter"/>
            </td>
       </tr>     
    </table>
   </div>
  </body>
</html>
